package Exceptions;

import squarePackage.Square;
import be.kuleuven.cs.som.annotate.Basic;
import be.kuleuven.cs.som.annotate.Immutable;


/**
 * A class that signals exceptions for invalid minimum and maximum temperatures for a square
 * Every exception contains the illegal minimum & maximum temperature and the square
 * 
 * @author Pieter & An
 *
 */


public class IllegalMinMaxTemperatureException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5910977058912327675L;

	/**
	 * *Initialize the new illegal minimum& maximum temperature exception with given minimum & maximum temperature & given square
	 * @param	minT
	 * 			the minimum temperature for the illegal minimum& maximum temperature exception
	 * @param	maxT
	 * 			the maximum temperature for the illegal minimum& maximum temperature exception
	 * @param 	square
	 * 			the square for the illegal temperature exception
	 * @post	The minimum temperature of the new illegal minimum & maximum temperature exception is the given  minimum temperature
	 * 			|new.getMinT() = minT
	 * @post	The maximum temperature of the new illegal minimum & maximum temperature exception is the given  maximum temperature
	 * 			|new.getMaxT() = maxT
	 * @post	The square of the new illegal minimum & maximum temperature exception is the given square
	 * 			|new.getSquare() = square
	 */			
	public IllegalMinMaxTemperatureException(double minT, double maxT, Square square){
		this.minT = minT;
		this.maxT = maxT;
		this.square = square;
		
	}
	
	/**
	 * Variable referring the minimum temperature of the illegal minimum & maximum temperature exception
	 */
	private final double minT;
	
	/**
	 * Variable referring the maximum temperature of the illegal minimum & maximum temperature exception
	 */
	private final double maxT;
	
	/**
	 * Variable referring the square of the illegal minimum & maximum temperature exception
	 */
	private final Square square;
	
	/**
	 * 
	 * @return the minimum temperature of the illegal minimum & maximum temperature exception
	 */
	@Basic @Immutable
	public double getMinT(){
		return minT;
	}
	
	/**
	 * 
	 * @return the maximum temperature of the illegal minimum & maximum temperature exception
	 */
	@Basic @Immutable
	public double getMaxT(){
		return maxT;
	}
	/**
	 * 
	 * @return the square of the illegal minimum & maximum temperature exception
	 */
	@Basic @Immutable
	public Square getSquare(){
		return square;
	}
}
